package com.xishu.controller;

import com.xishu.annotation.valid.MethodValidator;
import com.xishu.entity.area.Area;
import com.xishu.response.ResponseData;
import com.xishu.service.CommonService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@Api(description = "地区控制器")
@RestController
public class AreaController {
    private Map areaMap = new HashMap<String, String>();

    @ApiOperation(value = "搜索地区")
    @PutMapping(value = ("/area"), produces = ("application/json;charset=UTF-8"))
    @MethodValidator(mustLogin = false)
    public ResponseData searchArea(@RequestBody Area area) throws Exception {
        return CommonService.getInstance().searchResponse(area);
    }
}
